<!-- 
封装图片管理的带插入的组件
调用<InsertImg   @returnimg="returnimg"></InsertImg>
回调事件，返回 图片的地址
 -->

<template>
	<div class="all-img" style="display:inline-block;">
		<div  @click="show=true">
			<slot>
				<button type="button" class="ivu-btn ivu-btn-ghost">
					<i class="ivu-icon ivu-icon-ios-cloud-upload-outline"></i>
				</button>
			</slot>
		</div>
		<div class="v-transfer-dom" v-show="show">
			<div class="ivu-modal-mask" ></div>
		 	<div class="ivu-modal-wrap " >
		 		<div class=" p-10">
		 			<div class="ivu-modal-content">
		 				<a class="ivu-modal-close" @click="show=false">
		 					<i class="ivu-icon ivu-icon-ios-close-empty"></i>
		 				</a> 
		 				<div class="ivu-modal-header">
		 					<div class="ivu-modal-header-inner">插入图片</div>
		 				</div>
		 				<div class="ivu-modal-body">
		 					<PhotoViewer @returnimg="returnImg" :insert="true"></PhotoViewer>
          	</div>
            <div class="ivu-modal-footer">
            	<div>
            		<button type="button" class="ivu-btn ivu-btn-primary ivu-btn-large" @click="show=false">取消</button> 

            	</div>
          	</div>
          </div>
        </div>
      </div>
    </div>
	</div>
</template>


<script>

export default {
	name: 'InsertImg',
	data () {
		return {
			imgArr:[],
      current:1,//当前页码
      total:0,//总条数
      pageSize:23,//每页条数
      isUpload:false,//是否上传
      percent:0,//上传进度条
      show:false
    }
  },
  created(){
  	
  },
  computed: {
  	
  },
	methods:{
		returnImg:function(imgurl){
			this.show=false;
			this.$emit('returnimg',imgurl);
		}
	}

}
</script>
<style >

</style>